<?php
    header("content-type:text/html;charset=utf-8");
    $config = include_once('../../public/config/config.php');
    include_once('../../public/func/db.php');
    $table = 'user';
    $arr = select($config,$table,'where id='.$_GET['id'],'','uname');
    if($arr[0]['uname'] == 'admin'){
        die("<script>alert('管理员不可删除！');window.location.href='user.php'</script>");
    }
    $res = delete($config,$table,$_GET['id']);
    if(empty($res)){
        die("<script>alert('删除成功！');window.location.href='user.php'</script>");
    }else{
        die("<script>alert('删除失败！');window.location.href='user.php'</script>");
    }
?>